package syntax;

//import com.modeliosoft.modelio.javadesigner.annotations.objid;
//@objid ("0028eaba-bec4-10d9-ac48-082e5f2773a2")
public class Operator {

    public enum Op {

        LT {
            public String toString() {
                return "<";
            }
        },
        LE {
            public String toString() {
                return "<=";
            }
        },
        EQ {
            public String toString() {
                return "=";
            }
        },
        GE {
            public String toString() {
                return ">=";
            }
        },
        GT {
            public String toString() {
                return ">";
            }
        };

        public static Op getLT() {
            return LT;
        }

        public static Op getLE() {
            return LE;
        }

        public static Op getEQ() {
            return EQ;
        }

        public static Op getGE() {
            return GE;
        }

        public static Op getGT() {
            return GT;
        }
    }
    Op op;

    public Operator(Op op) {
        this.op = op;
    }

    public static Op parseOperator(String opStr) {
        if (opStr.compareTo("<") == 0) {
            return Op.getLT();
        } else if (opStr.compareTo("<=") == 0) {
            return Op.getLE();
        } else if (opStr.compareTo("=") == 0) {
            return Op.getEQ();
        } else if (opStr.compareTo(">=") == 0) {
            return Op.getGE();
        } else {
            return Op.getGT();
        }
    }
}
